package com.lykj.modules.shop.service.impl;

import com.lykj.core.secure.LykjUser;
import com.lykj.core.secure.utils.AuthUtil;
import com.lykj.core.tool.utils.DateUtil;
import com.lykj.modules.shop.entity.UserExtract;
import com.lykj.modules.shop.excel.UserExtractExcel;
import com.lykj.modules.shop.vo.UserExtractVO;
import com.lykj.modules.shop.mapper.UserExtractMapper;
import com.lykj.modules.shop.service.UserExtractService;
import com.lykj.core.mp.base.BaseServiceImpl;
import com.lykj.modules.system.service.UserService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 提现表 服务实现类
 *
 * @author cxl
 * @since 2022-01-21
 */
@Service
public class UserExtractServiceImpl extends BaseServiceImpl<UserExtractMapper, UserExtract> implements UserExtractService {

	@Override
	public IPage<UserExtractVO> selectUserExtractPage(IPage<UserExtractVO> page, UserExtractVO userExtract) {
		return page.setRecords(baseMapper.selectUserExtractPage(page, userExtract));
	}

	@Override
	public List<UserExtractExcel> export(UserExtractVO userExtract){
		return baseMapper.export(userExtract);
	}

	/**
	 * 获取累计分红总额
	 */
	@Override
	public BigDecimal sumAmount(){
		return baseMapper.sumAmount();
	}

	@Override
	public BigDecimal sumUserAmount(Long userAccount) {
		return baseMapper.sumUserAmount(userAccount);
	}
}
